/***************************************************************************
 **
 **  Copyright (C) 2021 MaMinJie <canpool@163.com>
 **  Contact: https://github.com/canpool
 **           https://gitee.com/icanpool
 **
 **  GNU Lesser General Public License Usage
 **  Alternatively, this file may be used under the terms of the GNU Lesser
 **  General Public License version 3 as published by the Free Software
 **  Foundation and appearing in the file LICENSE.LGPL3 included in the
 **  packaging of this file. Please review the following information to
 **  ensure the GNU Lesser General Public License version 3 requirements
 **  will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
 **
 **  GNU General Public License Usage
 **  Alternatively, this file may be used under the terms of the GNU
 **  General Public License version 2.0 or (at your option) the GNU General
 **  Public license version 3 or any later version approved by the KDE Free
 **  Qt Foundation. The licenses are as published by the Free Software
 **  Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
 **  included in the packaging of this file. Please review the following
 **  information to ensure the GNU General Public License requirements will
 **  be met: https://www.gnu.org/licenses/gpl-2.0.html and
 **  https://www.gnu.org/licenses/gpl-3.0.html.
 **
****************************************************************************/
#ifndef LITERIBBONBAR_H
#define LITERIBBONBAR_H

#include <QWidget>
#include "qlite_global.h"

QLITE_BEGIN_NAMESPACE

class LiteQuickAccessBar;
class LiteToolBar;
class LiteBar;
class LiteRibbonPage;
class LiteRibbonBarPrivate;

/* LiteRibbonBar */
class QLITE_SHARED_EXPORT LiteRibbonBar : public QWidget
{
    Q_OBJECT
public:
    enum RibbonStyle {
        ClassicStyle,   // default, office-like
        MergedStyle,
    };

    enum ToolBarPosition {
        ToolBarTopPosition,
        ToolBarBottomPosition,
    };

public:
    explicit LiteRibbonBar(QWidget *parent);
    virtual ~LiteRibbonBar();

    LiteRibbonPage *addPage(const QString &text);
    LiteRibbonPage *addPage(const QIcon &icon, const QString &text);
    void addPage(LiteRibbonPage *page);
    LiteRibbonPage *insertPage(int index, const QString &text);
    LiteRibbonPage *insertPage(int index, const QIcon &icon, const QString &text);
    void insertPage(int index, LiteRibbonPage *page);

    void movePage(LiteRibbonPage *page, int newIndex);
    void movePage(int index, int newIndex);

    void removePage(LiteRibbonPage *page);
    void removePage(int index);

    void detachPage(LiteRibbonPage *page);
    void detachPage(int index);

    void clearPages();

    LiteRibbonPage *page(int index) const;
    int pageCount() const;
    int currentPageIndex() const;
    QList<LiteRibbonPage *> pages() const;

    LiteQuickAccessBar *quickAccessBar() const;

    RibbonStyle ribbonStyle() const;
    void setRibbonStyle(RibbonStyle style);

    LiteToolBar *toolBar(ToolBarPosition position) const;
    LiteBar *liteBar() const;

    void updateParentFlags();

Q_SIGNALS:

private:
    LiteRibbonBarPrivate *d;
};

QLITE_END_NAMESPACE

#endif // LITERIBBONBAR_H
